#pragma once
#include "ReconstructByKinectCommon.h"
#include <vector>
#include <QImage>
#include "ImageDenoise.h"
#include "Vertex.hpp"
#include "PatternCalibrationProcess.h"

class ReconstructProcess
{
public:

	ReconstructProcess ();
	~ReconstructProcess ();

	void addSensor (SensorDataInput *pSensor);
	const SensorDataInput *getSensor (size_t index) const;
	SensorDataInput *getSensor (size_t index);
	size_t getSensorsCount () const;

	bool grabNewFrameAndProcess ();
	void registration ();
// 	void generateModels ();
// 	void generateTextures ();

// 	std::vector< ModelObject * > &getModels ();
// 	const std::vector< ModelObject * > &getModels () const;

	std::vector< std::vector< Vertex > > &getVerticesClouds ();
	const std::vector< std::vector< Vertex > > &getVerticesClouds () const;

	std::vector< QImage * > &getTextures ();
	const std::vector< QImage * > &getTextures () const;

	std::vector< std::vector< Vertex > > &getOverlapClouds ();

private:

	std::vector< PatternCalibrationProcess * > _calibratorPtrs;
	std::vector< SensorDataInput * > _sensors;
// 	std::vector< ModelObject * > _models;
	std::vector< std::vector< Vertex > > _verticesClouds;
	std::vector< std::vector< glm::uvec3 > > _faces;
	std::vector< std::vector< Vertex > > _overlapClouds;
	std::vector< QImage * > _textures;
	glm::mat4x4 _kinectTransformMat;
	glm::mat4x4 _kinectToWorldMat;

// 	void _addModel ();
	void _statistic ();
};

